{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "975e4738",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting tang.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile tang.py\n",
    "\n",
    "tang_v =10\n",
    "\n",
    "def tang_add(tang_list):\n",
    "    tang_sum =0\n",
    "    for i in range(len(tang_list)):\n",
    "        tang_sum += tang_list[i]\n",
    "    return tang_sum\n",
    "tang_list = [1,2,3,4,5]\n",
    "print(tang_add(tang_list))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "7f2af086",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15\n"
     ]
    }
   ],
   "source": [
    "%run tang.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "77ced60a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15\n"
     ]
    }
   ],
   "source": [
    "import tang"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "ec9a03b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tang"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8b7da750",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<module 'tang' from 'D:\\\\OpenSource\\\\Tags\\\\python-learn\\\\tang.py'>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "ebd03c88",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10\n"
     ]
    }
   ],
   "source": [
    "print(tang.tang_v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "5c68d55f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang.tang_v =100\n",
    "tang.tang_v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b0a85a86",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_list=[10,11,12]\n",
    "tang.tang_add(tang_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "4688ef72",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tang as tg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ffc805ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tg.tang_v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d78b5278",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tg.tang_add(tang_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e90dc67f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from tang import  tang_v,tang_add"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "34006c81",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "c2515b39",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "33"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_add(tang_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "106c38fc",
   "metadata": {},
   "outputs": [],
   "source": [
    "from tang import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "37210454",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "100"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_v"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "84eefbe1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tang_add(tang_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4b423d0a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.remove('tang.py')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "0acb6b37",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\OpenSource\\\\Tags\\\\python-learn'"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.abspath(\".\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a29978b5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
